<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>Testing while developing &#8212; Pytch  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
    <link rel="stylesheet" type="text/css" href="../../_static/classic.css?v=36340f97" />
    <link rel="stylesheet" type="text/css" href="../../_static/css/pytch-classic.css?v=0321735e" />
    
    <script src="../../_static/documentation_options.js?v=7f41d439"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    
    <link rel="icon" href="../../_static/favicon.ico"/>
    <link rel="author" title="About these documents" href="../../about.html" />
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Making a deployment zipfile" href="making-deployment-zipfile.html" />
    <link rel="prev" title="Querying status of all repos" href="querying-repo-status.html" /> 
  </head><body>
<div class="NavBar">
  <a href="../../../app/"><h1>Pytch</h1></a>
  <ul>
    <a href="https://pytch.scss.tcd.ie/"><li>About Pytch</li></a>
    <a href="../../index.html"><li>Help</li></a>
    <a href="../../../app/tutorials/"><li>Tutorials</li></a>
    <a href="../../../app/my-projects/"><li>My projects</li></a>
  </ul>
</div>
<div class="warning-work-in-progress">
  <p>These help pages are incomplete — we are working on it!</p>
</div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="testing-while-developing">
<span id="local-development-server"></span><h1>Testing while developing<a class="headerlink" href="#testing-while-developing" title="Link to this heading">¶</a></h1>
<p>A script</p>
<div class="highlight-text notranslate"><div class="highlight"><pre><span></span>makesite/local-server/dev-server.sh
</pre></div>
</div>
<p>is provided which launches a five-way <code class="docutils literal notranslate"><span class="pre">tmux</span></code> session.  The panes
contain individual shell scripts for the following pieces:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">dev-server-webapp.sh</span></code> — An <code class="docutils literal notranslate"><span class="pre">npm</span></code>-based server for the React
webapp itself.  Uses various environment variables (including some
loaded from a <code class="docutils literal notranslate"><span class="pre">.env</span></code> file) to configure the webapp’s behaviour.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">dev-server-live-reload-watch.sh</span></code> — A websocket server for
live-reload of code and tutorial content.  See
<a class="reference internal" href="../live-reload/index.html"><span class="doc">Using an external editor</span></a> for details of this mechanism.  This
piece only does anything if the environment variable
<code class="docutils literal notranslate"><span class="pre">PYTCH_IN_PROGRESS_TUTORIAL</span></code> is set.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">dev-server-skulpt.sh</span></code> — A Python-based web server for the
Skulpt-based VM.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">dev-server-tutorials.sh</span></code> — A Python-based web server for the
tutorial bundle and components.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">dev-server-medialib.sh</span></code> — Builds the media library and serves it
over HTTP.</p></li>
</ul>
<p>For example,</p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span><span class="nb">cd</span><span class="w"> </span>makesite/local-server
<span class="nv">PYTCH_IN_PROGRESS_TUTORIAL</span><span class="o">=</span>space-invaders<span class="w"> </span>./dev-server.sh
</pre></div>
</div>
<p>will launch the required servers for working on a tutorial in a
subdirectory <code class="docutils literal notranslate"><span class="pre">space-invaders</span></code> of the <code class="docutils literal notranslate"><span class="pre">pytch-tutorials</span></code> repo.</p>
<p>Everything is tied together with a bundle of environment variables.
See the individual scripts for details.</p>
<section id="serving-demo-zips">
<h2>Serving demo zips<a class="headerlink" href="#serving-demo-zips" title="Link to this heading">¶</a></h2>
<p>Experimental: The local development server specifies that demo zips
can be found at <code class="docutils literal notranslate"><span class="pre">localhost:8126</span></code> but does not launch a server at
that port.  The companion repo <code class="docutils literal notranslate"><span class="pre">pytch-demos</span></code> has its own development
server for this.  In live deployments, the demos are maintained
separately from the release / beta process.  This arrangement might
evolve as we gain experience with the mechanism for providing
non-tutorial demos.</p>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper"><ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../webapp/user/index.html">Using the Pytch web app</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../vm/user/index.html">Writing Pytch programs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../about.html">About Pytch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../contact.html">Contact</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../developer.html">Developer documentation</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../developer/development-setup.html">Development setup</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../developer/design-overview.html">Design overview</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../vm/developer/index.html">VM</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../webapp/developer/index.html">Webapp</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../medialib/developer/index.html">Media library</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../developer/index.html">Website</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../index.html">Tools</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../index.html#tutorial-compiler-and-related-tools">Tutorial compiler and related tools</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../index.html#assembly-of-website-bundle">Assembly of website bundle</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../source-build.html">Source and build information</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../releases/changelog.html">Changelog</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../legal/index.html">Legal information</a></li>
</ul>
<div class="docs-home-link"><hr>
  <ul>
    <li>
      <a href="../../index.html">Pytch help home</a>
    <li>
  </ul>
</div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
  </body>
</html>